<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="utf-8">
    <meta name="keywords" content="CSS总结, HTML,CSS,JavaScript,JQuery,React,Vue.js等">
    <meta name="description" content="别做一个Vue api调用师">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>CSS总结 | zihao blog</title>
    <link rel="icon" type="image/png" href="/pride-blog/favicon.png">

    <link rel="stylesheet" type="text/css" href="/pride-blog/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/pride-blog/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/pride-blog/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/pride-blog/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/pride-blog/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/pride-blog/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/pride-blog/css/my.css">

    <script src="/pride-blog/libs/jquery/jquery.min.js"></script>

<meta name="generator" content="Hexo 5.3.0"><link rel="stylesheet" href="/pride-blog/css/prism-tomorrow.css" type="text/css"><!-- hexo-inject:begin --><!-- hexo-inject:end --></head>




<body>
    <!-- hexo-inject:begin --><!-- hexo-inject:end --><header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/pride-blog/" class="waves-effect waves-light">
                    
                    <img src="/pride-blog/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">zihao blog</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/pride-blog/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/pride-blog/categories/CSS/" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/pride-blog/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/pride-blog/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">zihao blog</div>
        <div class="logo-desc">
            
            别做一个Vue api调用师
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/pride-blog/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/pride-blog/categories/CSS/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/pride-blog/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        
    </ul>
</div>


        </div>

        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('/pride-blog/medias/featureimages/11.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">CSS总结</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/pride-blog/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/pride-blog/tags/CSS/">
                                <span class="chip bg-color">CSS</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/pride-blog/categories/CSS/" class="post-category">
                                CSS
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2021-03-04
                </div>
                

                

                

                

                
            </div>
        </div>
        <hr class="clearfix">

        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <p>2021.8.9 补充</p>
<h4 id="盒模型"><a href="#盒模型" class="headerlink" title="盒模型"></a>盒模型</h4><ul>
<li>W3C 标准盒模型: box-sizing:content-box 盒子 width=content(内容的 width) + 2 * padding + 2 * border;</li>
<li>IE 怪异盒模型:box-sizing:border-box 盒子 width = content(content内包含 padding + border)</li>
</ul>
<h5 id="如何设置两种盒模型"><a href="#如何设置两种盒模型" class="headerlink" title="如何设置两种盒模型"></a>如何设置两种盒模型</h5><pre class=" language-CSS"><code class="language-CSS">box-sizing : content-box // W3C标准盒模型
box-sizing : border-box // IE怪异盒模型</code></pre>
<h4 id="BFC-Block-Formatting-Context-块级格式上下文"><a href="#BFC-Block-Formatting-Context-块级格式上下文" class="headerlink" title="BFC(Block Formatting Context):块级格式上下文"></a>BFC(Block Formatting Context):块级格式上下文</h4><p>可以把 BFC 特性的元素看成一个隔离的容器,容器内部的元素的布局不会影响到外面的元素;</p>
<ul>
<li>浮动元素:float 除了 none 以外的值;</li>
<li>绝对定位:Positon(absolute fixed);</li>
<li>display 为 inline-block/flex/teble-cells;</li>
<li>overflow 除了 visible 以外的值(hidden/ auto/scroll)</li>
</ul>
<p>BFC的特性</p>
<ul>
<li>内部的box会在垂直方向上一个接一个的放置</li>
<li>垂直方向上的距离由margin决定</li>
<li>BFC的区域不会与float的元素区域重叠</li>
<li>BFC就是页面上一个独立的容器,容器里面的子元素不会影响外面的元素</li>
</ul>
<h4 id="CSS-选择器"><a href="#CSS-选择器" class="headerlink" title="CSS 选择器"></a>CSS 选择器</h4><ul>
<li>id 选择器(#id Name)</li>
<li>类选择器(.class name)</li>
<li>标签选择器( Tag Name)</li>
<li>通配符选择器(*)</li>
<li>相邻选择器(h1 + p {margin-top:50px;})<br>注释:如果需要选择紧接在另一个元素后的元素，而且二者有相同的父元素</li>
<li>子选择器:(ul &gt; li)</li>
<li>后代选择器(ul &gt; li)</li>
<li>伪类选择器(:link/:visited/:active/:hover/:before/:after)</li>
</ul>
<h4 id="CSS3-新增伪类"><a href="#CSS3-新增伪类" class="headerlink" title="CSS3 新增伪类"></a>CSS3 新增伪类</h4><ul>
<li>:first-child(匹配父元素中的第一个元素)</li>
<li>:last-child(匹配父元素中的最后一个元素)</li>
<li>:nth-child(n) (匹配父元素中的第 n 个元素)<ul>
<li>nth-child(odd):奇数</li>
<li>nth-child(even):偶数</li>
</ul>
</li>
</ul>
<h4 id="CSS-优先级计算规则"><a href="#CSS-优先级计算规则" class="headerlink" title="CSS 优先级计算规则"></a>CSS 优先级计算规则</h4><ul>
<li>行内样式 &gt; ID 选择器 （权重 100）&gt; 类选择器 （权重 10）= 属性选择器 = 伪类选择器 &gt; 标签选择器 （权重 1）= 伪元素选择器 &gt; 通配符选择器</li>
<li>!important 拥有最高优先级</li>
</ul>
<h4 id="HTML-中引入-CSS-的方式"><a href="#HTML-中引入-CSS-的方式" class="headerlink" title="HTML 中引入 CSS 的方式"></a>HTML 中引入 CSS 的方式</h4><ul>
<li>行内样式:直接在 HTML 标签中的 style 属性中添加 CSS</li>
</ul>
<pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span><span class="token style-attr language-css"><span class="token attr-name"> <span class="token attr-name">style</span></span><span class="token punctuation">="</span><span class="token attr-value"><span class="token property">background</span><span class="token punctuation">:</span> red</span><span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>div</span><span class="token punctuation">></span></span></code></pre>
<ul>
<li>嵌入方式:直接在 HTML 文件中的 style 标签内写 CSS</li>
</ul>
<pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">></span></span><span class="token style language-css">
    <span class="token number">.</span>content &amp;<span class="token hexcode">#123</span><span class="token punctuation">;</span>
      <span class="token property">background</span><span class="token punctuation">:</span> red<span class="token punctuation">;</span>
    &amp;<span class="token hexcode">#125</span><span class="token punctuation">;</span>
  </span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">></span></span></code></pre>
<ul>
<li>链接方式:使用 HTML 头部的<head>标签引入外部的 CSS 文件</li>
</ul>
<pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>head</span><span class="token punctuation">></span></span>
  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>link</span> <span class="token attr-name">rel</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>stylesheet<span class="token punctuation">"</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>text/css<span class="token punctuation">"</span></span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>style.css<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>head</span><span class="token punctuation">></span></span></code></pre>
<ul>
<li>导入方式:指的是使用 CSS 规则引入外部 CSS 文件</li>
</ul>
<pre class=" language-html"><code class="language-html"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>style</span><span class="token punctuation">></span></span><span class="token style language-css">
  <span class="token atrule"><span class="token rule">@import</span> <span class="token url">url(style.css)</span><span class="token punctuation">;</span></span>
</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>style</span><span class="token punctuation">></span></span></code></pre>
<h4 id="link-引入-CSS-和-import-引入的区别"><a href="#link-引入-CSS-和-import-引入的区别" class="headerlink" title="link 引入 CSS 和@import 引入的区别"></a>link 引入 CSS 和@import 引入的区别</h4><ul>
<li>link 属于 html 标签,除了引入 CSS 样式以外还可以定义 RSS 等其他事物,@import 是 CSS 提供的规则,只能引入 CSS</li>
<li>link 标签是在页面加载的时候会同时加载,@import 引入的 CSS 要等页面加载结束后再加载</li>
<li>link 是 html 标签，没有兼容性，@import 只有 ie5 以上才能识别</li>
</ul>
<h4 id="文本属性"><a href="#文本属性" class="headerlink" title="文本属性"></a>文本属性</h4><ul>
<li>单行文本省略</li>
</ul>
<pre class=" language-CSS"><code class="language-CSS">.title&#123;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
&#125;</code></pre>
<ul>
<li>多行文本省略</li>
</ul>
<pre class=" language-CSS"><code class="language-CSS">
.title-2&#123;
overflow : hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
&#125;</code></pre>
<h4 id="CSS-有哪些属性可以继承"><a href="#CSS-有哪些属性可以继承" class="headerlink" title="CSS 有哪些属性可以继承"></a>CSS 有哪些属性可以继承</h4><ul>
<li>字体系列属性：如 font，font-family，font-size，font-weight，font-style</li>
<li>文本系列属性：如 color，text-indent(文本缩进)，text-align(文本水平对齐)，line-height，word-spacing(字间隔)</li>
<li>元素可见性：visibility</li>
<li>表格布局属性：caption-side、border-collapse、border-spacing、empty-cells、table-layout</li>
<li>列表属性：list-style-type、list-style-image、list-style-position、list-style<br>cursor</li>
</ul>
<h4 id="display-有哪些值"><a href="#display-有哪些值" class="headerlink" title="display 有哪些值"></a>display 有哪些值</h4><ul>
<li>inline（默认）–内联</li>
<li>none–隐藏</li>
<li>block–块显示</li>
<li>table–表格显示</li>
<li>list-item–项目列表</li>
<li>inline-block-内联块</li>
<li>flex</li>
<li>grid-网格布局</li>
</ul>
<h4 id="display-none-与-visibility-hidden-的区别"><a href="#display-none-与-visibility-hidden-的区别" class="headerlink" title="display:none 与 visibility:hidden 的区别"></a>display:none 与 visibility:hidden 的区别</h4><ul>
<li>是否占据空间<ul>
<li>display:none 该元素不占据任何空间,在文档渲染过程中,该元素不存在;</li>
<li>visibility:hidden 该元素空间依然存在;也会出现在渲染树中;</li>
</ul>
</li>
<li>是否渲染<ul>
<li>display:none 会触发 reflow(回流),进行渲染;</li>
<li>visibility:hidden 只会触发 repaint(重绘),因为没有发现位置的改变,所以不会触发 reflow(重排);</li>
</ul>
</li>
<li>是否具有继承性<ul>
<li>display:none 不是继承属性,元素和子元素都会消失;</li>
<li>visibility:hidden 是继承属性;</li>
</ul>
</li>
</ul>
<h4 id="RGBA-和-opacity-有什么区别"><a href="#RGBA-和-opacity-有什么区别" class="headerlink" title="RGBA 和 opacity 有什么区别"></a>RGBA 和 opacity 有什么区别</h4><ul>
<li>rbga 只作用于元素自身的颜色或者背景颜色,对元素内容没有影响;</li>
<li>opacity 只作用于元素自身的颜色或背景色的同时,也作用于元素内的内容的透明度;</li>
</ul>
<h4 id="CSS-预处理器"><a href="#CSS-预处理器" class="headerlink" title="CSS 预处理器"></a>CSS 预处理器</h4><p>CSS 预处理器是 一种语言来为 CSS 增加一些编程的特性,无需考虑浏览器的兼容性问题;</p>
<ul>
<li>less变量符是@</li>
<li>scss变量符是$</li>
</ul>
<h4 id="Flex-布局"><a href="#Flex-布局" class="headerlink" title="Flex 布局"></a>Flex 布局</h4><p>参考这里<br><a href="http://zihaoxiong.gitee.io/pride-blog/2021/030520650.html">Flex 布局</a></p>
<h4 id="CSS3-新特性"><a href="#CSS3-新特性" class="headerlink" title="CSS3 新特性"></a>CSS3 新特性</h4><ul>
<li>过渡:transition<br>transition： CSS 属性，花费时间，效果曲线(默认 ease)，延迟时间(默认 0)<br>举例:</li>
</ul>
<pre class=" language-CSS"><code class="language-CSS">/*宽度从原始值到制定值的一个过渡，运动曲线ease,运动时间0.5秒，0.2秒后执行过渡*/
transition：width,0.5s,ease,0.2s
/*所有属性从原始值到制定值的一个过渡，运动曲线ease,运动时间0.5秒*/
transition：all,0.5s
</code></pre>
<ul>
<li>动画:animation<br>animation：动画名称，一个周期花费时间，运动曲线（默认 ease），动画延迟（默认 0），播放次数（默认 1），是否反向播放动画（默认 normal），是否暂停动画（默认 running）<br>举例:</li>
</ul>
<pre class=" language-CSS"><code class="language-CSS">/*执行一次mymove动画，运动时间2秒，运动曲线为 linear*/
animation: mymove 2s linear;
@keyframes mymove
  &#123;
    from &#123;left:0px;&#125;
    to &#123;left:200px;&#125;
&#125;

/*2秒后开始执行一次mymove动画，运动时间2秒，运动曲线为 linear*/
animation: mymove 2s linear 2s;

/*无限执行mymove动画，每次运动时间2秒，运动曲线为 linear，并且执行反向动画*/
animation: mymove 2s linear alternate infinite;</code></pre>
<ul>
<li>转换:transform<br>transform:适用于 2D 或 3D 转换的元素<br>transform:scale放大缩小 rotate旋转 translate偏移</li>
</ul>
<pre class=" language-CSS"><code class="language-CSS">transform:rotate(30deg); // 旋转30°</code></pre>
<p><img src="https://i.loli.net/2021/08/09/7uD6NZmte5fjRiS.png" alt="CSS-transform.png"></p>
<pre class=" language-CSS"><code class="language-CSS">transform:translate(30px,30px); // 偏移(X和Y轴)各偏移30px</code></pre>
<p><img src="https://i.loli.net/2021/08/09/axtPQp1AW8yckrj.png" alt="CSS-transform-translate.png"></p>
<pre class=" language-CSS"><code class="language-CSS">transform:scale(0.8); // 缩放至0.8</code></pre>
<p><img src="https://i.loli.net/2021/08/09/KTMuPlpZtgFASyz.png" alt="CSS-transform-scale.png"></p>
<pre class=" language-CSS"><code class="language-CSS">transform: skew(10deg,10deg); // 扭曲,X轴和Y轴各扭曲10°</code></pre>
<p><img src="https://i.loli.net/2021/08/09/KTMuPlpZtgFASyz.png" alt="CSS-transform-scale.png"></p>
<ul>
<li>阴影(shadow)</li>
</ul>
<pre class=" language-CSS"><code class="language-CSS">// box-shadow: 水平阴影的位置 垂直阴影的位置 模糊距离 阴影的大小 阴影的颜色 阴影开始方向
//(默认是从里往外，设置inset就是从外往里)
box-shadow: 10px 10px 5px #888888;
text-shadow: 2px 2px #ff0000;</code></pre>
<ul>
<li>媒体查询<br>就在监听屏幕尺寸的变化，在不同尺寸的时候显示不同的样式！在做响应式的网站里面，是必不可少的一环<pre class=" language-CSS"><code class="language-CSS">body &#123;
  background-color: pink;
&#125;
@media screen and (max-width: 960px) &#123;
  body &#123;
      background-color: darkgoldenrod;
  &#125;
&#125;
@media screen and (max-width: 480px) &#123;
  body &#123;
      background-color: lightgreen;
  &#125;
&#125;</code></pre>
</li>
</ul>

                
            </div>
            <hr/>

            



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/pride-blog/tags/CSS/">
                                    <span class="chip bg-color">CSS</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/pride-blog/libs/share/css/share.min.css">
<div id="article-share">

    

    

</div>

                </div>
            </div>
            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/pride-blog/2021/030520650.html">
                    <div class="card-image">
                        
                        
                        <img src="/pride-blog/medias/featureimages/16.jpg" class="responsive-img" alt="CSS-Flex 弹性布局">
                        
                        <span class="card-title">CSS-Flex 弹性布局</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2021-03-05
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/pride-blog/categories/CSS/" class="post-category">
                                    CSS
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/pride-blog/tags/CSS/">
                        <span class="chip bg-color">CSS</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                本篇&nbsp;<i class="far fa-dot-circle"></i>
            </div>
            <div class="card">
                <a href="/pride-blog/2021/030435250.html">
                    <div class="card-image">
                        
                        
                        <img src="/pride-blog/medias/featureimages/11.jpg" class="responsive-img" alt="CSS总结">
                        
                        <span class="card-title">CSS总结</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2021-03-04
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/pride-blog/categories/CSS/" class="post-category">
                                    CSS
                                </a>
                            
                            
                        </span>
                    </div>
                </div>

                
                <div class="card-action article-tags">
                    
                    <a href="/pride-blog/tags/CSS/">
                        <span class="chip bg-color">CSS</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/pride-blog/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/pride-blog/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/pride-blog/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/pride-blog/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/pride-blog/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    

    <div class="container row center-align"
         style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2021-2023</span>
            
            <span id="year">2021</span>
            <a href="/pride-blog/about" target="_blank">zihao xiong</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            
            
            
            
            <br>

            <!-- 运行天数提醒. -->
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link ">














</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/pride-blog/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/pride-blog/libs/materialize/materialize.min.js"></script>
    <script src="/pride-blog/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/pride-blog/libs/aos/aos.js"></script>
    <script src="/pride-blog/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/pride-blog/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/pride-blog/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/pride-blog/libs/others/clicklove.js" async="async"></script>
    
    

    

    

    <!--腾讯兔小巢-->
    
    
    <script type="text/javascript" color="0,0,255"
        pointColor="0,0,255" opacity='0.7'
        zIndex="-1" count="99"
        src="/pride-blog/libs/background/canvas-nest.js"></script>
    

    
    
    <script type="text/javascript" size="150" alpha='0.6'
        zIndex="-1" src="/pride-blog/libs/background/ribbon-refresh.min.js" async="async"></script>
    

    
    <script type="text/javascript" src="/pride-blog/libs/background/ribbon-dynamic.js" async="async"></script>
    

    
    <script src="/pride-blog/libs/instantpage/instantpage.js" type="module"></script><!-- hexo-inject:begin --><!-- hexo-inject:end -->
    

</body>
<script src="./../source/js/cursor.js"></script>

</html>
